home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / tlxinstl.zip / INSTALL.ASM < prev    next >
Assembly Source File  |  1991-10-17  |  30KB  |  1,689 lines

  1.  
  2. EXTRN    ERRHAND:FAR
  3. EXTRN    BORDER:FAR
  4. EXTRN    MAKELOGO:FAR
  5. EXTRN    GETKEY:FAR
  6. EXTRN    WELCOME:FAR
  7.  
  8. .model small
  9. .stack
  10.  
  11. IF1
  12. INCLUDE     ASSEMBLY.MAC
  13. ENDIF
  14.  
  15. total_mem    equ    02H
  16. cr    equ    0DH
  17. lf    equ    0AH
  18. eof    equ    1AH
  19.  
  20. psp_comnd    equ    0082H
  21. enviorment    equ    2CH
  22.  
  23. .DATA
  24.  
  25. text_color    db    0
  26. back_color    db    0
  27. hi_light_color    db    0
  28. reverse_color    db    0
  29. border_color    db    0
  30. screen_attr    db    0
  31. inv_screen_attr db    0
  32.  
  33. pgm_file1    db    "BLUE.COM",0
  34. pgm_file2    db    "CLR.COM",0
  35. pgm_file3    db    "XCOPY.EXE",0
  36. zip_string    db    "pkunzip.exe",0
  37. chngdrive    db    "  ",0
  38. root        db    "\",0
  39. docdir        db    "document",0
  40. updir        db    "upload",0
  41. downdir     db    "download",0
  42. scriptdir    db    "script",0
  43. extexe        db    "*.exe",0
  44. extcom        db    "*.com",0
  45. extmdm        db    "*.mdm",0
  46. extkey        db    "*.key",0
  47. extdoc        db    "*.doc",0
  48. extnew        db    "*.new",0
  49. extme        db    "*.me",0
  50. extslc        db    "*.slc",0
  51. extslt        db    "*.slt",0
  52. todocdir    db    "\document",0
  53. toslcdir    db    "\script",0
  54. tlx_1        db    "tlx315-*.zip",0
  55. tlx_2        db    "tlx315-2.zip",0
  56. tlx_3        db    "tlx315-3.zip",0
  57. cmd_line1    db    80    dup    (?)
  58. cmd_line2    db    80    dup    (?)
  59. cmd_line3    db    80    dup    (?)
  60. cmd_line4    db    80    dup    (?)
  61. cmd_line5    db    80    dup    (?)
  62. zipcmdstr    db    80    dup    (?)
  63. cmdpass     dw    0      ;offset to parameter variable
  64. parm_blk    db    14    dup    (?)
  65. reg_save    db    10    dup    (?)
  66.  
  67. ANYKEY        DB    ' Hit any key to continue '
  68. ADDRESS1    DB    ' 911 Arnold Way '
  69. ADDRESS2    DB    ' San Jose, Ca 95128 '
  70. COPYRIGHT    DB    ' Copyright CUSTOM SOFTWARE 1991 '
  71. FNAME        DB    'FileName: '
  72. SOURCE        DB    'Source drive: '
  73. DESTINATION    DB    'Destination drive: '
  74. RECOMMEND    DB    'These are the Recommended directories: '
  75. RETURN        DB    'Press return to accept: '
  76. ESCAPE        DB    'Press escape to quit: '
  77. PHONE        DB    ' 408-297-9660 '
  78. SCREEN_TITLE    DB    ' TELIX INSTALLATION'
  79. VERSION     DB    ' VERSION 1.00 '
  80.  
  81. logo1        db   'Welcome to the Telix'
  82. logo2        db   'Installation Program'
  83. nopathstr    db   ' ALL PATHS NOT SELECTED CORRECTLY '
  84.  
  85. DRIVE        DB    24    DUP(0)
  86. FILENAME    DB    34    DUP      (" ")
  87. SOURCENAME    DB    'A:', 32      DUP       (" ")
  88. DESTNAME    DB    'C:\TELIX', 28      DUP       (" ")
  89. WILDNAME    DB    34    DUP      (" ")
  90. MEMORY_TOTAL    DW    0
  91.  
  92. mrow         db    0      ;offset to parameter variable
  93. mcol         dw    0      ;offset to parameter variable
  94. dlen         dw    0      ;offset to parameter variable
  95. mscrn         dw    0      ;offset to parameter variable
  96. fldname      dw    0      ;offset to parameter variable
  97. vidname      dw    0      ;offset to parameter variable
  98. fldtype      dw    0      ;offset to parameter variable
  99. updated      dw    0      ;offset to parameter variable
  100.  
  101. BYTES_READ    DW    0
  102. CHAR        DW    '  '
  103. CHAR_STR    DB    0,1,' ',0     ;use to strsearch for a character
  104. COL        DW    ?    ;Contains the current column
  105. COL_HOLD    DW    0
  106. ERROR        DB    0
  107. DTA_SEARCH_BUF    DB    43    DUP(0)
  108. DTA_STORE    DB    43        DUP(0)
  109. FCB_1        DB    43    DUP(?)
  110. FCB_2        DB    43    DUP(?)
  111. FILE_SIZE    DW    4    DUP(0)
  112. FIL_HND     DW    0        ;DOS FILE HANDLE
  113. FL_BUF        DB    82    DUP(" ")        ;Disk file buffer
  114. FILOPN        DB    0        ;FILE OPEN FLAG
  115. ROW        DB    ?    ;Contains the current row
  116.  
  117. ALLOCATED_MEMORY  DW 0
  118. DOCUMENT_MEMORY   DW 0
  119. dup_chk_ptr      dw 0
  120. boxtl          dw        0
  121. boxtr          dw        0
  122. boxbl          dw        0
  123. boxbr          dw        0
  124. colcnt          dw        0
  125. card_name      db '   '
  126. CRLF          DB    CR,LF
  127. cursor_location   dw        ?
  128. ENVIORMENT_SEG      dw  0
  129. MEMORY_SEGMENT      DW 0
  130. field_name      db '     '
  131. field_start      dw   0
  132. field_stop      dw   0
  133. linecnt       dw        0
  134. maxlen          db ?               ;maximum input string length
  135. max_page      db ?               ;number of highest directory page
  136. space          db      1      dup      (" ")
  137. retcode       dw        ?
  138. stat_port      dw        ?
  139. video_port      dw        ?
  140. video_address      dw ?               ;window start address
  141. video_segment      dw 0B800h           ;video segment address
  142. video_page      db ?               ;current video page
  143.  
  144. PUBLIC    ENVIORMENT_SEG,ERROR,ALLOCATED_MEMORY,MEMORY_SEGMENT
  145. PUBLIC    CHAR,CHAR_STR,COL,COL_HOLD,fname,row,boxtl
  146. PUBLIC    boxtr,boxbl,boxbr,colcnt,cursor_location,field_start,field_stop
  147. PUBLIC    inv_screen_attr,linecnt,screen_attr,fil_hnd,fl_buf
  148. PUBLIC    filename,sourcename,destname,wildname,source,destination,escape,return
  149. PUBLIC    fcb_1,fcb_2,file_size,bytes_read,recommend
  150. PUBLIC    screen_title,copyright,anykey,address1,address2,phone
  151. PUBLIC    CRLF,version,stat_port,video_address,filopn
  152. PUBLIC mrow,text_color
  153. PUBLIC mcol,back_color
  154. PUBLIC dlen,hi_light_color
  155. PUBLIC mscrn,reverse_color
  156. PUBLIC fldname,border_color
  157. PUBLIC fldtype
  158. PUBLIC vidname
  159. PUBLIC pgm_file1,pgm_file2,pgm_file3
  160. PUBLIC cmd_line1,cmd_line2,cmd_line3,cmd_line4,cmd_line5
  161. PUBLIC root,docdir,updir,downdir,scriptdir,tlx_1,tlx_2,tlx_3
  162. PUBLIC extdoc,extslc,extslt,extexe,extcom
  163. PUBLIC cmdpass
  164. PUBLIC parm_blk
  165. PUBLIC reg_save
  166. PUBLIC logo1
  167. PUBLIC logo2
  168.  
  169. .CODE
  170. .STARTUP
  171.  
  172. ;******************************************************************************
  173.  
  174. INSTALL     PROC
  175.  
  176.     jmp    go
  177. stk_seg dw    0
  178. stk_ptr dw    0
  179.  
  180. go:
  181.     mov    ax,es            ;get segment of enviorment block
  182.     mov    enviorment_seg,ax    ;from psp and save it
  183.  
  184. ;--------- save psp information to create child process later -----------------
  185.  
  186.     mov    word ptr parm_blk[04],ds
  187.     mov    word ptr parm_blk[06],5CH
  188.     mov    word ptr parm_blk[08H],ax
  189.     mov    word ptr parm_blk[0AH],6CH
  190.     mov    word ptr parm_blk[0CH],ax
  191.  
  192.     mov    ax,0100h        ;turn off curser
  193.     mov    bx,0
  194.     mov    cx,0200h
  195.     mov    dx,00
  196.     int    10h
  197.  
  198.     CALL    CLS
  199.  
  200. ;;;;;;;;;;;;;;;;;;  EQUIP_CHK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  201.     int    11H
  202.     and    al,00110000B    ;;is it B/W?
  203.     cmp    al,00110000B
  204.     mov    ax,0b000H    ;;assume B/W
  205.     mov    stat_port,03baH
  206.     je    seg_ok
  207.     mov    ax,0b800H    ;;no, set color
  208.     mov    stat_port,03daH
  209. seg_ok:
  210.     mov    video_address,ax
  211.     mov    ES,AX          ;screen is connected
  212.     cmp    AX,0B000H
  213.     jne    COLOR
  214.  
  215. SCREEN    SEGMENT  AT   0B000H      ;Monochrome screen
  216. SCREEN    ENDS
  217.  
  218.     mov     text_color,07h
  219.     mov     back_color,0
  220.     mov     hi_light_color,15h
  221.     mov     reverse_color,70h
  222.     mov     border_color,07h
  223.     mov     screen_attr,07H
  224.     mov     inv_screen_attr,70H
  225.  
  226.     JMP  SHORT   SET_SCREEN
  227.  
  228. COLOR:
  229.     CALL    BLUE
  230. SCREEN    SEGMENT  AT   0B800H      ;Color screen
  231. SCREEN    ENDS
  232.  
  233.     mov     text_color,07h
  234.     mov     back_color,0
  235.     mov     hi_light_color,15h
  236.     mov     reverse_color,70h
  237.     mov     border_color,07h
  238.     mov     screen_attr,07H
  239.     mov     inv_screen_attr,70H
  240.  
  241. SET_SCREEN:
  242.     ASSUME    ES:SCREEN
  243.  
  244.     CALL    BORDER
  245.     CALL    MAKELOGO
  246. get_welcome:
  247.     CALL    CLS
  248.     CALL    BORDER
  249.     CALL    WELCOME
  250.     cmp    al,1bh
  251.     jne    storesource
  252.     jmp    err_exit;
  253.  
  254. storesource:
  255.     mov    row,14
  256.     mov    col,35
  257.     STORE_FIELD  sourcename,34
  258.     mov    si,offset sourcename      ;check that source name is not blank
  259.     mov    al,[si]
  260.     cmp    al,20h
  261.     jne    storedest
  262.     call    cls
  263.     call    nopath
  264.     jmp    get_welcome
  265. storedest:
  266.     mov    row,16
  267.     mov    col,35
  268.     STORE_FIELD  destname,34
  269.     mov    si,offset destname    ;check that dest name is not blank
  270.     mov    al,[si]
  271.     cmp    al,20h
  272.     jne    dest_ok
  273.     call    cls
  274.     call    nopath
  275.     jmp    get_welcome
  276. dest_ok:
  277.     call    cls
  278.     calc_addr 10,10
  279.     cursor
  280.  
  281.     xor    ax,ax
  282.     xor    dx,dx
  283.     mov    si,offset destname
  284.     mov    dl,[si]
  285.     cmp    dl,60h
  286.     jb    nc
  287.     sub    dl,20h
  288. nc:
  289.     sub    dl,40h
  290.     dec    dl
  291.     mov    ah,0EH
  292.     int    21h
  293.     jc    err_exit
  294.  
  295.     xor    ax,ax
  296.     mov    ah,3bH
  297.     mov    dx,offset root    ;change to root dir
  298.     int    21h
  299.     jc    err_exit
  300.     xor    ax,ax
  301.     mov    ah,39H
  302.     mov    dx,offset destname  ;make telix directory
  303.     int    21h
  304.     jnc    telix_ok
  305.     cmp    al,5
  306.     jne    err_exit
  307. telix_ok:
  308.     xor    ax,ax
  309.     mov    ah,3bH
  310.     mov    dx,offset destname   ;change to telix directory
  311.     int    21h
  312.     jc    err_exit
  313.     xor    ax,ax
  314.     mov    ah,39H
  315.     mov    dx,offset docdir  ;make document directory
  316.     int    21h
  317.     jnc    doc_ok
  318.     cmp    al,5
  319.     jne    err_exit
  320. doc_ok:
  321.     xor    ax,ax
  322.     mov    ah,39H
  323.     mov    dx,offset updir  ;make upload directory
  324.     int    21h
  325.     jnc    up_ok
  326.     cmp    al,5
  327.     jne    err_exit
  328. up_ok:
  329.     xor    ax,ax
  330.     mov    ah,39H
  331.     mov    dx,offset downdir  ;make download directory
  332.     int    21h
  333.     jnc    down_ok
  334.     cmp    al,5
  335.     jne    err_exit
  336. down_ok:
  337.     xor    ax,ax
  338.     mov    ah,39H
  339.     mov    dx,offset scriptdir  ;make script directory
  340.     int    21h
  341.     jnc    script_ok
  342.     cmp    al,5
  343.     jne    err_exit
  344. script_ok:
  345.     call    cls
  346.     call    copycmd
  347.  
  348.     mov    dx,offset tlx_1
  349.     call    unzip_exe
  350.     mov    dx,offset zipcmdstr
  351.     mov    word ptr parm_blk[02],offset cmd_line2
  352.     CALL    EXEC_COM
  353.     cmp    error,1
  354.     je    err_exit
  355.  
  356.     mov    dx,offset tlx_1
  357.     call    unzip_com
  358.     mov    dx,offset zipcmdstr
  359.     mov    word ptr parm_blk[02],offset cmd_line2
  360.     CALL    EXEC_COM
  361.     cmp    error,1
  362.     je    err_exit
  363.  
  364.     mov    dx,offset tlx_1
  365.     call    unzip_key
  366.     mov    dx,offset zipcmdstr
  367.     mov    word ptr parm_blk[02],offset cmd_line2
  368.     CALL    EXEC_COM
  369.     cmp    error,1
  370.     je    err_exit
  371.  
  372.     mov    dx,offset tlx_1
  373.     call    unzip_mdm
  374.     mov    dx,offset zipcmdstr
  375.     m